<?php

require_once 'zheng_ze.class.php';

$regex = new regexTool();
if(!$regex->noEmpty($_POST['username']))
	echo "<script>alert('用户名不能为空！！！');window.location.href='reg.html';</script>";

if(!$regex->isEmail($_POST['email']))
	echo "<script>alert('非法邮箱！！！');window.location.href='reg.html';</script>";

if(!$regex->isMobile($_POST['mobile']))
	echo "<script>alert('手机号错误！！！');window.location.href='reg.html';</script>";

//数据库写入
//
//
//
//
//
//
function show($var = null,$isdump = false){
	$func = $isdump ? 'var_dump' : 'print_r';
	if(empty($var)){
		echo 'null';
	}elseif (is_array($var) || is_object($var)) {
		//array,object
		echo '<pre>';
		$func($var);
		echo '</pre>';
	}else {
		//string,int float...
		$func($var) ;
	}}




?>